package com.boarsoft.boar.batch.demo.flow;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.boarsoft.boar.batch.demo.biz.DemoBatchBiz;
import com.boarsoft.boar.batch.demo.entity.Demo1;
import com.boarsoft.flow.core.bean.JudgeHandler;
import com.boarsoft.hibernate.biz.SimpleBizImpl;

public class DemoFlowBatchJudge1 extends SimpleBizImpl implements JudgeHandler {
	@Autowired
	protected DemoBatchBiz biz;

	/**
	 * 判断是否有数据
	 */
	@SuppressWarnings("unchecked")
	@Override
	public boolean judge(Object data, Throwable throwable) {
		if (data == null) {
			return false;
		}
		Map<String, Object> pm = (Map<String, Object>) data;
		List<Demo1> lt = (List<Demo1>) pm.get("list");
		return (lt != null && !lt.isEmpty());
	}
}
